function saveBackground() {
	
	jQuery(function() {
    	var usr_nome	= jQuery.trim(jQuery("#usr_nome").val());
    	var usr_email	= jQuery.trim(jQuery("#usr_email").val());
    	var usr_foneCom = jQuery.trim(jQuery("#usr_foneCom").val());
        	
        if(usr_nome != "" && usr_email != "" && usr_foneCom != ""){
        	jQuery.ajax({
        		url: 'classes/vaga/VagPrincipal.class.php',
    			type: 'POST',
				data: "state=salvaBackground&"+jQuery("#usr_nome, #usr_email, #usr_foneCom, #emp_razaosocial, #emp_nomefantasia, #emp_tempEmp_id, #usr_cargoc").serialize(),
                dataType: "text",
                success: function(id){
                	jQuery("#emp_tempEmp_id").val(id);
                }
        	});
        }
    });
}

jQuery(document).ready(function(){
	
    jQuery("#usr_nome, #usr_email, #usr_foneCom, #emp_razaosocial, #emp_nomefantasia, #emp_tempEmp_id").blur(saveBackground);
    jQuery("#usr_cargoc").change(saveBackground);
});
